﻿using SqlSugar;
using YL.Utils.Extensions;

namespace YL.Core.Entity
{
    [SugarTable("whr_course_apply")]
    public class Whr_course_apply
    {
        /// <summary>
        /// 申请id
        /// </summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
        public int ApplyId { get; set; }

        /// <summary>
        /// 用户id
        /// </summary>
        [SugarColumn(ColumnName = "user_id")]
        public int UserId { get; set; }

        /// <summary>
        /// 学生id
        /// </summary>
        [SugarColumn(ColumnName = "student_id")]
        public int StudentId { get; set; }

        /// <summary>
        /// 课程id
        /// </summary>
        [SugarColumn(ColumnName = "course_id")]
        public int CourseId { get; set; }

        /// <summary>
        /// 添加时间
        /// </summary>
        [SugarColumn(ColumnName = "create_at")]
        public int CreateAt { get; set; } = DateTimeExt.GetUnixTimestamp();

        /// <summary>
        /// 状态
        /// </summary>
        [SugarColumn(ColumnName = "status")]
        public byte Status { get; set; }

        /// <summary>
        /// 申请需要助力次数
        /// </summary>
        [SugarColumn(ColumnName = "support_times")]
        public int SupportTimes { get; set; }
        
        /// <summary>
        /// 剩余可助力的次数，防止超员分享
        /// </summary>
        [SugarColumn(ColumnName = "left_times")]
        public int LeftTimes { get; set; }

        /// <summary>
        /// 过期时间
        /// </summary>
        [SugarColumn(ColumnName = "expire")]
        public int Expire { get; set; }
    }
}
